package question2.test1;
/*请编写程序，使用 Calendar 类获取日历对象，
        并分别获取年、月、日、小时、分、秒, 并将它们打印到控制台。
        说明：这里由于 Calender没有学习，建议使用 LocalDateTime 类去完成。*/

import java.util.Calendar;

public class CalenderDemo {
    public static void main(String[] args) {
        Calendar instance = Calendar.getInstance();
        int year = instance.get(Calendar.YEAR);
        int month = instance.get(Calendar.MONTH)+1;
        int week=instance.get(Calendar.WEEK_OF_MONTH)-1;
        int day = instance.get(Calendar.DAY_OF_MONTH);
        int hour = instance.get(Calendar.HOUR_OF_DAY);
        int minutes= instance.get(Calendar.MINUTE);
        int seconds = instance.get(Calendar.SECOND);
        System.out.println(year);
        System.out.println(month);
        System.out.println(day);
        System.out.println(hour);
        System.out.println(minutes);
        System.out.println(seconds);
    }
}
